From 4df87c91b1f5c65f96a98cdf66ee783dac649329 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Wed, 29 Mar 2006 16:50:59 +0100 Subject: [PATCH] Free shadows of any pages which are released by a domain back to Xen. This should fix the "Assertion '! IS_INVALID_M2P_ENTRY(gpfn)'"-crash in free_shadow_page on domain destruction. Signed-off-by: Christian Limpach --- xen/include/asm-x86/shadow.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h index ca988bbece..28d50466ea 100644 --- a/xen/include/asm-x86/shadow.h +++ b/xen/include/asm-x86/shadow.h @@ -1506,6 +1506,7 @@ static inline void guest_physmap_remove_page( struct domain *d, unsigned long gpfn, unsigned long mfn) { struct domain_mmap_cache c1, c2; + unsigned long type; if ( likely(!shadow_mode_translate(d)) ) return; @@ -1514,6 +1515,8 @@ static inline void guest_physmap_remove_page( domain_mmap_cache_init(&c2); shadow_lock(d); shadow_sync_and_drop_references(d, mfn_to_page(mfn)); + while ( (type = shadow_max_pgtable_type(d, gpfn, NULL)) != PGT_none ) + free_shadow_page(__shadow_status(d, gpfn, type)); set_p2m_entry(d, gpfn, -1, &c1, &c2); set_gpfn_from_mfn(mfn, INVALID_M2P_ENTRY); shadow_unlock(d); -- 2.30.2